package com.cloud.demo.common.tool;

import com.auth0.jwt.JWT;
import com.auth0.jwt.JWTVerifier;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.exceptions.SignatureVerificationException;
import com.cloud.demo.common.enums.ResultEnum;
import com.cloud.demo.common.web.exception.SysException;
import lombok.extern.slf4j.Slf4j;

import java.security.SignatureException;
@Slf4j
public class JwtTool {
    private final String signatureVerificationException = "";

    public static JWTVerifier verifier(String sale){
        JWTVerifier build =null;
        try {
             build = JWT.require(Algorithm.HMAC256(sale)).build();
        }catch (SignatureVerificationException sve){
            sve.printStackTrace();
            throw new SysException(ResultEnum.);
        }

        return build;
    }
}
